<?php
abstract class Pageley_Util_AbstractCipher implements Pageley_Util_Cipher {
    private $salts;
    
    public function __construct($salts = null) {
        if($salts === null) {
            $salts = new Pageley_Util_ArrayMap();
        }
        if($salts->size() == 0) {
            $salts->add("Pageley");
        }
        $this->salts = $salts;
    }
    
    public function encrypt($value) {
        $result = $value;
        foreach($this->salts as $salt) {
            $result = $this->encryptInternal($salt . $result);
        }
        return $result;
        
    }
    
    protected abstract function encryptInternal($value);
}